package com.fw;

import com.fw.annotation.NoAction;
import com.fw.core.Controller;

public class LoginCtroller extends Controller {

	public void logout(){
		UserInfo userInfo = getModel(UserInfo.class);
		System.out.println(userInfo.getUsername());
		System.out.println(userInfo.getPassword());
		renderText(userInfo.getUsername() + " is ok?");
	}
	
	public void login(UserInfo user){
		UserInfo userInfo = getModel(UserInfo.class);
		System.out.println(user == null);
		System.out.println(userInfo.getUsername());
		System.out.println(userInfo.getPassword());
		renderText(userInfo.getUsername() + " is ok?");
	}
	
	public void logError(UserInfo user){
		UserInfo userInfo = getModel(UserInfo.class);
		System.out.println(user == null);
		System.out.println(userInfo.getUsername());
		System.out.println(userInfo.getPassword());
		if(user.getUsername() == null) {
			throw new RuntimeException("name is null");
		}
		renderText(userInfo.getUsername() + " is ok?");
	}
	
	@NoAction
	public void nolog(){
		System.out.println("nolog");
		renderText("nolog is ok?");
	}

}
